<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/APP/User/Main/Page.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/APP/User/Main</a> Page.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/19</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/4</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/11</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/19</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div o-Container o-Container-App v-bind:style="{}"&gt;
    &lt;van-nav-bar title="我的" v-bind="{fixed:true}"&gt;&lt;/van-nav-bar&gt;
    &lt;div class="containerMask"&gt;&lt;/div&gt;
    &lt;div v-bind:style="{width:'100%',height:'100px',display:'flex',alignItems:'center'}"&gt;
      &lt;div
        v-bind:style="{paddingTop:'20px',width:'56px',height:'56px',backgroundColor:'#008FFF',marginLeft:'20px',borderRadius:'28px'}"&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;div v-bind:style="{marginLeft:'15px',fontSize:'22px'}"&gt;
          {{octopus.passport.name}}
        &lt;/div&gt;
        &lt;div v-bind:style="{color: '#666666',fontSize:'14px',marginLeft:'15px'}"&gt;
          职位：物业经理 | 工号：007
        &lt;/div&gt;
      &lt;/div&gt;
&nbsp;
    &lt;/div&gt;
    &lt;div v-bind:style="{height:'10px',width:'100%',backgroundColor: '#F6F6F6'}"&gt;&lt;/div&gt;
    &lt;van-cell-group&gt;
      &lt;van-cell title="设置密码" is-link v-on:click="octopus.router.jump('/APP/User/Main/SetPassword')"/&gt;
      &lt;van-cell title="清空缓存" is-link v-on:click="clean"/&gt;
      &lt;van-cell title="问题反馈" is-link v-on:click="octopus.router.jump('/APP/User/Main/Feedback')"/&gt;
      &lt;van-cell title="关于我们" is-link/&gt;
      &lt;van-cell title="平台公告" is-link/&gt;
      &lt;van-cell title="NFC识别" v-on:click="NFCScan" is-link/&gt;
      &lt;div class="NFCFFFFF"&gt;
&lt;!--        {{fileList}}--&gt;
        &lt;div v-for="file in fileList"&gt;
          {{file.file.name}}, {{file.file.type}}, {{file.file.size/1024}}K
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;van-cell&gt;
        &lt;template slot="title"&gt;
          图像上传
&lt;!--          capture="camera" (直调摄像头) --&gt;
          &lt;van-uploader :after-read="afterRead" v-model="fileList" :max-count="5"
                       :max-size="4096000" @oversize="oversized"/&gt;
        &lt;/template&gt;
      &lt;/van-cell&gt;
      &lt;!--      &lt;van-cell title="退出登陆" v-on:click="showClosePanel" v-bind:style="{'text-align':'center'}"/&gt;--&gt;
    &lt;/van-cell-group&gt;
    &lt;div slot="action" @click="showClosePanel"
         v-bind:style="{marginTop:'80px',marginLeft:'25px',marginRight:'25px',height:'48px',backgroundColor:'#008FFF',borderRadius: '4px',textAlign:'center',lineHeight:'48px',fontSize: '16px',color:'#fff'}"&gt;
      退出登录
    &lt;/div&gt;
    &lt;van-popup v-model="closePanel" v-bind="{position:'bottom',round:true,class:'closePanel'}"&gt;
      &lt;van-cell-group&gt;
        &lt;van-cell title="退出后不会删除任何历史数据，下次依然可以使用本账号。" v-bind="{class:'note'}"/&gt;
        &lt;van-cell title="退出登陆" v-on:click="exit" v-bind="{class:'exit'}"/&gt;
        &lt;van-cell title="取消" v-on:click="closePanel=false" v-bind="{class:'cancel'}"/&gt;
      &lt;/van-cell-group&gt;
    &lt;/van-popup&gt;
&nbsp;
&nbsp;
    &lt;o-app-menu&gt;&lt;/o-app-menu&gt;
  &lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
  export default {
    name: "mms_engine_database_item", /* 这个name暂时不知道用啥用，根据官方文档说的是方便排错的 */
<span class="fstat-no" title="function not covered" >    data() {</span>
<span class="cstat-no" title="statement not covered" >      return {</span>
        octopus: this.$parent.octopus,
        NFCData: "",
        fileList: [],
        closePanel: false
      }
    },
    // 只会执行一次
<span class="fstat-no" title="function not covered" >    mounted: function () {</span>
    },
<span class="fstat-no" title="function not covered" >    activated:function(){</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.success("NFCReturn已挂载。");</span>
<span class="cstat-no" title="statement not covered" >      window.NFCReturn = this.NFCReturn;</span>
<span class="cstat-no" title="statement not covered" >      window.NFCError = this.NFCError;</span>
    },
    methods: {
<span class="fstat-no" title="function not covered" >      exit: function () {</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.passport.appKey = "";</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.passport.token = "";</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.passport.password = "";</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.router.jumplogin();</span>
      },
<span class="fstat-no" title="function not covered" >      showClosePanel: function () {</span>
<span class="cstat-no" title="statement not covered" >        this.closePanel = true;</span>
      },
<span class="fstat-no" title="function not covered" >      clean: function () {</span>
<span class="cstat-no" title="statement not covered" >        alert("清空缓存");</span>
      },
<span class="fstat-no" title="function not covered" >      NFCScan: function () {</span>
<span class="cstat-no" title="statement not covered" >        if (window.NFCStart) {</span>
<span class="cstat-no" title="statement not covered" >          window.NFCStart();</span>
<span class="cstat-no" title="statement not covered" >        }</span>
        else if(window.Android){
<span class="cstat-no" title="statement not covered" >          window.Android.NFCStart();</span>
        }
      },
<span class="fstat-no" title="function not covered" >      NFCReturn: function (value) {</span>
<span class="cstat-no" title="statement not covered" >        $(".NFCFFFFF").html(JSON.stringify(value));</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.tips.success("NFC Return Data:" + JSON.stringify(value));</span>
      },
<span class="fstat-no" title="function not covered" >      NFCError:function(value){</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.tips.success("NFC Return Data:" + JSON.stringify(value));</span>
      },
<span class="fstat-no" title="function not covered" >      afterRead(param) {</span>
        // 此时可以自行将文件上传至服务器
<span class="cstat-no" title="statement not covered" >        console.log(param);</span>
&nbsp;
        // 压缩图像教程
        // https://juejin.im/post/5c1890b1518825046c2f67b7
        // if (/\/(?:jpeg|png)/i.test(param.file.type) &amp;&amp; param.file.size &gt; 2048*1024) {
        //   // 创建Canvas对象(画布)
        //   let canvas = document.createElement('canvas')
        //   // 获取对应的CanvasRenderingContext2D对象(画笔)
        //   let context = canvas.getContext('2d')
        //   // 创建新的图片对象
        //   let img = new Image()
        //   // 指定图片的DataURL(图片的base64编码数据)
        //   img.src = param.content
        //   // 监听浏览器加载图片完成，然后进行绘制
        //   img.onload = () =&gt; {
        //     // 指定canvas画布大小，该大小为最后生成图片的大小
        //     canvas.width = 40
        //     canvas.height = 30
        //     /* drawImage画布绘制的方法。(0,0)表示以Canvas画布左上角为起点，400，300是将图片按给定的像素进行缩小。*/
        //     /* 如果不指定缩小的像素，图片将以图片原始大小进行绘制，图片像素如果大于画布将会从左上角开始按画布大小部分绘制图片，最后得到的图片就是张局部图。图片小于画布就会有黑边。*/
        //     context.drawImage(img, 0, 0, 40, 30)
        //     // 将绘制完成的图片重新转化为base64编码，file.file.type为图片类型，0.92为默认压缩质量
        //     param.content = canvas.toDataURL(param.file.type, 0.60)
        //     // 最后将base64编码的图片保存到数组中，留待上传。
        //     // if (this.imgBase64.length &lt; 6) {
        //     //   this.imgBase64.push(file.content)
        //     // } else {
        //     //   alert("最多上传6张图片")
        //     // }
        //     console.log(param);
        //   }
        // }
      },
      // 因为要图像压缩，所以自带的大小检测就报废了。原来的注解为：:max-size="2048000" @oversize="oversized"
<span class="fstat-no" title="function not covered" >      oversized: function (file) {</span>
<span class="cstat-no" title="statement not covered" >        alert("文件超过大小:" + (JSON.stringify(file).length / 1024) + "K");</span>
      }
    },
    props: ["oData"]
  }
&nbsp;
  // setTimeout(function () {
  //   NFCReturn("123");
  // },5000);
&nbsp;
  // function NFCReturn(value) {
  //   $(".NFCFFFFF").html("111111");
  //   alert(JSON.stringify(value));
  // }
  //
  // // 这个js函数在OC被调用
  // function returnNFC(value) {
  //   $(".NFCFFFFF").html("222222");
  //   alert(JSON.stringify(value));
  // };
&lt;/script&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>
